#include<stdio.h>

int main(int argc, char *argv[])
{
	int year;
	int month;
	int day;
	int leap;//判断闰年
	int i;//循环
	int sum =0;

	printf("请输入一个日期（年，月，日）（逗号间隔）：");
	scanf("%d,%d,%d", &year, &month, &day);
	
	if((0==year%4&&0!=year%100)||(0==year%400)){
		leap = 1;
	}else{
		leap = 0;
	}

	for(i=1;i<month;i++){
		switch(i){
			case 1: case 3: case 5: case 7: case 8: case 10: case 12:
				sum += 31;
				break;
			case 2:
				if(leap==1){
					sum+=29;
				}else{
					sum+=28;
				}
				break;
			default:
				sum+=30;
				break;
		}
	}
	printf("%d年%d月%d日是这一年的第%d天！\n", year, month, day, sum+=day);
	return 0;
}
